package com.muy.redis.common.tree.actions;

import com.intellij.icons.AllIcons;
import com.muy.redis.common.tree.MTTreeCell;
import com.muy.redis.common.tree.TreePanelMark;
import com.muy.redis.view.component.MrRedisEditorJpanelLeft;

import javax.swing.tree.DefaultMutableTreeNode;

/**
 * @Author jiyanghuang
 * @Date 2022/8/7 12:45
 */
public class ReloadRedisOneDbAction extends AbstractMTTreeCellSelectTreeAction{

    public ReloadRedisOneDbAction(TreePanelMark treePanelMark) {
        super("Refresh", "Refresh", AllIcons.Actions.Refresh, treePanelMark);
    }

    public ReloadRedisOneDbAction(TreePanelMark treePanelMark, String title, String desc) {
        super(title, desc, AllIcons.Actions.BuildAutoReloadChanges, treePanelMark);
    }

    @Override
    public void handleSelectTree(DefaultMutableTreeNode mutableTreeNode, MTTreeCell mtTreeCell) {
        MrRedisEditorJpanelLeft mrRedisEditorJpanelLeft = (MrRedisEditorJpanelLeft)treePanelMark;
        mrRedisEditorJpanelLeft.renderKeyTree();
    }
}
